package com.yoomiito.app.ui.my.songdudouo

import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.View
import com.yoomiito.app.Constant
import com.yoomiito.app.base.App
import com.yoomiito.app.model.bean.TabBean
import com.yoomiito.app.ui.my.MyOrderBaseActivity
import com.yoomiito.app.utils.Const

class GiveMoreIncomeActivity :MyOrderBaseActivity<GiveMoreIncomePresenter>(){
    private val types = arrayOf(Constant.NAMAL_TYPE_INCOME_FREE_GIFT,Constant.NAMAL_TYPE_INCOME_GIVEMORE)
    companion object{
        fun start(context: Context){
            val intent = Intent(context,GiveMoreIncomeActivity::class.java)
            context.startActivity(intent)
        }
    }

    override fun initData(savedInstanceState: Bundle?) {
        super.initData(savedInstanceState)
        titleView?.setCenterText("送多多收益")
        desTitleTv.text = "累计收益"
        desTv.visibility = View.GONE
    }

    override fun getAllFragment(): MutableList<GiveMoreIncomeFragment>{
        val list = mutableListOf<GiveMoreIncomeFragment>()
        types.forEach {
            val fm = GiveMoreIncomeFragment()
            val bundle = Bundle()
            bundle.putInt(Const.Common.Key,it)
            fm.arguments = bundle
            list.add(fm)
        }
        return list
    }

    override fun newP(): GiveMoreIncomePresenter = GiveMoreIncomePresenter(App.mAppConfig)

    override fun getTabList(): MutableList<TabBean> = mutableListOf(
            TabBean("赠品",0,false),
            TabBean("送多多礼包",0,false)
    )

}